#include "Queue.h"
using namespace std;

template <class T>
Queue<T>::Queue()
{
    m_rear = m_top = new Node();
    m_size = 0;
}

template <class T>
void Queue<T>::Clear()
{
    m_size = 0;
    while (m_top != m_rear)
    {
        Node *p = m_top;
        m_top = m_top->next;
        delete p;
    }
    delete m_top;
}

template <class T>
void Queue<T>::PustBack(const T &value)
{
    Node *temp = new Node(value);
    m_rear->next = temp;
    m_rear = temp;
    m_size++;
}

template <class T>
void Queue<T>::PopFront()
{
    Node *temp = m_top;
    m_top = m_top->next;
    delete temp;
}
